/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.login.plugin.b;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.qihoo.gamecenter.sdk.login.plugin.login.view.DropDownItemView;
import com.qihoo.gamecenter.sdk.login.plugin.login.view.DropDownItemView.a;
import java.util.ArrayList;

public class a extends BaseAdapter {
    private ArrayList a;
    private Context b;
    private String c;
    private DropDownItemView.a d;
    private String e;

    public a(Context paramContext, String paramString, DropDownItemView.a parama) {
        this.b = paramContext;
        this.a = new ArrayList();
        this.c = paramString;
        this.d = parama;
    }

    public int getCount() {
        return this.a.size();
    }

    public String a(int paramInt) {
        return ((String) this.a.get(paramInt));
    }

    public long getItemId(int paramInt) {
        return paramInt;
    }

    public View getView(int paramInt, View paramView, ViewGroup paramViewGroup) {
        a locala;
        if (paramView == null) {
            locala = new a();
            paramView = new DropDownItemView(this.b, this.c);
            locala.a = ((DropDownItemView) paramView);
            paramView.setTag(locala);
        }
        else {
            locala = (a) paramView.getTag();
        }
        locala.a.a((String) this.a.get(paramInt), this.e, this.d);
        return paramView;
    }

    public void a(String paramString) {
        if ((this.a.remove(paramString)) && (this.e != null) && (this.e.equals(paramString)) && (this.a.size() > 0))
            this.e = ((String) this.a.get(0));
        notifyDataSetChanged();
    }

    public void a(String[] paramArrayOfString, String paramString) {
        if ((paramArrayOfString == null) || (paramArrayOfString.length == 0))
            return;
        this.a.clear();
        this.e = paramString;
        for (String str : paramArrayOfString)
            this.a.add(str);
        notifyDataSetChanged();
    }

    public void b(String paramString) {
        this.e = paramString;
        notifyDataSetChanged();
    }

    static class a {
        DropDownItemView a;
    }
}